home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 2 / CU Amiga Magazine's Super CD-ROM 02 (1996)(EMAP Images)(GB)[!][issue 1996-04].iso / magazine / amiga_e / ged-e / ec21b_uncomment.rexx < prev    next >
OS/2 REXX Batch file  |  1994-11-03  |  1KB  |  51 lines

  1. /* $VER: 1.5, ©1994 BURGHARD Eric.                            */
  2. /*             Uncomment an entire block                      */
  3.  
  4. options results                             /* enable return codes     */
  5.                                             /* not started by GoldEd ? */
  6. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then address 'GOLDED.1'
  7. 'LOCK CURRENT QUIET'                        /* lock GUI, gain access   */
  8. if rc then exit
  9. options failat 6                            /* ignore warnings         */
  10. signal on syntax                            /* ensure clean exit       */
  11.  
  12. 'QUERY MARKED'
  13. if result="FALSE" then 'REQUEST STATUS=" No block marked !"'
  14. else do
  15.     'QUERY ABSLINE COLUMN'
  16.     parse var result line ' ' col
  17.     'GOTO BLAST'
  18.     'QUERY ABSLINE VAR LLINE'
  19.     'GOTO BFIRST'
  20.     'QUERY ABSLINE VAR FLINE'
  21.     do l=fline for lline-fline+1
  22.         'FIRST'
  23.         'QUERY WORD'
  24.         if result="/*" then do
  25.             'GOTO EOL'
  26.             'PREV'
  27.             'QUERY WORD'
  28.             if result="*/" then do
  29.                 'DEL'
  30.                 'DEL'
  31.                 'FIRST'
  32.                 'DEL'
  33.                 'DEL'
  34.                 'DEL'
  35.             end
  36.         end
  37.         lne=l+1
  38.         'GOTO LINE='lne''
  39.     end
  40.     'BLOCK HIDE'
  41.     'GOTO COLUMN='col' LINE='line''
  42. end
  43. 'UNLOCK'
  44. exit
  45.  
  46. syntax:
  47. say "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  48. 'UNLOCK'
  49. exit
  50.  
  51.